package com.d0320hw;

import java.io.*;

public class Count {
    public static void main(String[] args) throws Exception {
        File file = new File("src/com/d0320hw/calcCharNum.txt");
        FileInputStream fis=new FileInputStream(file);
        DataInputStream dis=new DataInputStream(fis);
        int count=0;
        byte z;
        try{
            while(true)
            {
                z=dis.readByte();
                if(z==65||z==97)
                    count++;
            }
        }catch(Exception ex)
        {
            System.out.print("A和a出现了"+count+"次");
        }
    }
}
